'use strict';
const assert = require('assert');
module.exports = app => {
  app.passport.verify(async (ctx, user) => {
    const { username, password } = user;
    assert(username, '用户名必填');
    assert(password, '密码必填');
    return await ctx.service.user.verify(username, password);
  });
};
